# Author : baobao
# date : Week07

names_a = ["Mike","Mary","Jan","Jack"]
names_b = ["lihua","baobao","huihui"]

# 4.删除列表 某些时间段的-不常用
#names.clear()
#print(names)

# 5.合并列表 extend 是有顺序的,()里面的list排在后面
#names_a.extend(names_b)
#print(names_a)

#names_b.extend(names_a)
#print(names_b)

# 6. copy() 复制列表  赋值不等于真正意义上的复制
#names_a复制 = names_a
#print(names_a)
#print(names_a复制)
#names_a.append("xixi")
#print("names_a:",names_a)
#print("names_a复制:",names_a复制)

#names_a_源数据备份 = names_a.copy()
#print(names_a)
#print(names_a_copy)
#names_a.append("xixi")
#print("names_a:",names_a)
#print("names_a_copy:",names_a_copy)

# 用切片[:] 等价于copy()方法
names_a_源数据备份 =names_a[1:]
print(names_a)
print(names_a_源数据备份)
names_a.append("youge")
print("names_a:",names_a)
print("names_a_源数据备份：",names_a_源数据备份)


stu_id = [95,95,96,97,98]
# 7. count() 查看元素出现的次数/统计数量
print(stu_id.count(95))


#8、 sort()排序  reverse=True 从高到低，默认从低到高排序
stu_id.sort(reverse=True)
print(stu_id)

names_a.sort()
print(names_a)
# names_a.sort() 字符串排序方法
